



// This code is a generated code by a tool
// designed and coded by Shohdi Mohamed Elsheemy ( shohdi@gmail.com )            

using System;
using System.Collections.Generic;
using System.Web;
using System.Data.Common;
using Shohdi.DataHandler;
using System.Data;




namespace DatabaseComponent
{
    
    public partial class SupportDocumentsDB
    {
         string _Connection = "";


        public string Connection
        {
            get { return _Connection; }
            set { _Connection = value; }
        }


       
         string _Provider = "System.Data.SqlClient";

        
        public string Provider
        {
            get { return _Provider; }
            set { _Provider = value; }
        }



        public SupportDocumentsDB()
        {
        }

        public SupportDocumentsDB(string __Connection,params string [] __Provider)
        {

            if (__Provider.Length > 0)
                _Provider = __Provider[0];

            _Connection = __Connection;
            
        }




        public List<SupportDocuments> Select(ClassDataHandler con, string strTop, string strWhere, params DbParameter[] whereParams)
        {
            if (whereParams == null)
                whereParams = new DbParameter[0];

            List<SupportDocuments> lstRet = new List<SupportDocuments>();

            string strQuery = " select " + strTop  + " * from dbo.[SupportDocuments]  " ;

            if (strWhere != "")
            {
                strQuery = strQuery + "  " + strWhere;
            }

            DbDataReader dr = con.SelectDataReader(strQuery, CommandType.Text, whereParams);


            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    SupportDocuments obj = new SupportDocuments();
 if (dr["ID"] != DBNull.Value)
                    {
                        obj.ID = (System.Int64)dr["ID"];
                    }
                    else
                    {
                        obj.ID = -1;
                    } 
 if (dr["DocumentTitleEN"] != DBNull.Value)
                    {
                        obj.DocumentTitleEN = (System.String)dr["DocumentTitleEN"];
                    }
                    else
                    {
                        obj.DocumentTitleEN = "";
                    } 
 if (dr["DocumentTitleAR"] != DBNull.Value)
                    {
                        obj.DocumentTitleAR = (System.String)dr["DocumentTitleAR"];
                    }
                    else
                    {
                        obj.DocumentTitleAR = "";
                    } 
 if (dr["DocumentDescriptionEN"] != DBNull.Value)
                    {
                        obj.DocumentDescriptionEN = (System.String)dr["DocumentDescriptionEN"];
                    }
                    else
                    {
                        obj.DocumentDescriptionEN = "";
                    } 
 if (dr["DocumentDescriptionAR"] != DBNull.Value)
                    {
                        obj.DocumentDescriptionAR = (System.String)dr["DocumentDescriptionAR"];
                    }
                    else
                    {
                        obj.DocumentDescriptionAR = "";
                    } 
 if (dr["DocumentFile"] != DBNull.Value)
                    {
                        obj.DocumentFile = (System.String)dr["DocumentFile"];
                    }
                    else
                    {
                        obj.DocumentFile = "";
                    } 



                    lstRet.Add(obj);
                   

                }
            }

            dr.Close();


            return lstRet;
        }


        public List<SupportDocuments> Select(string strTop, string strWhere, params DbParameter[] whereParams)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            List<SupportDocuments> lstRet = Select(con, strTop, strWhere, whereParams);

            con.CloseConnection();

            return lstRet;
        }

        



        public void Insert(ClassDataHandler con , SupportDocuments obj)
        {
            
            

                    DbParameter prmDocumentTitleEN = con.createParameter();
                    prmDocumentTitleEN.ParameterName = "@DocumentTitleEN";
                    prmDocumentTitleEN.DbType =DbType.String;
                    if (obj.DocumentTitleEN == null)
                    {
                        prmDocumentTitleEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentTitleEN.Value = obj.DocumentTitleEN;
                    }
                

                    


                    DbParameter prmDocumentTitleAR = con.createParameter();
                    prmDocumentTitleAR.ParameterName = "@DocumentTitleAR";
                    prmDocumentTitleAR.DbType =DbType.String;
                    if (obj.DocumentTitleAR == null)
                    {
                        prmDocumentTitleAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentTitleAR.Value = obj.DocumentTitleAR;
                    }
                

                    


                    DbParameter prmDocumentDescriptionEN = con.createParameter();
                    prmDocumentDescriptionEN.ParameterName = "@DocumentDescriptionEN";
                    prmDocumentDescriptionEN.DbType =DbType.String;
                    if (obj.DocumentDescriptionEN == null)
                    {
                        prmDocumentDescriptionEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentDescriptionEN.Value = obj.DocumentDescriptionEN;
                    }
                

                    


                    DbParameter prmDocumentDescriptionAR = con.createParameter();
                    prmDocumentDescriptionAR.ParameterName = "@DocumentDescriptionAR";
                    prmDocumentDescriptionAR.DbType =DbType.String;
                    if (obj.DocumentDescriptionAR == null)
                    {
                        prmDocumentDescriptionAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentDescriptionAR.Value = obj.DocumentDescriptionAR;
                    }
                

                    


                    DbParameter prmDocumentFile = con.createParameter();
                    prmDocumentFile.ParameterName = "@DocumentFile";
                    prmDocumentFile.DbType =DbType.String;
                    if (obj.DocumentFile == null)
                    {
                        prmDocumentFile.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentFile.Value = obj.DocumentFile;
                    }
                

                    


           



            string strQuery = " insert into dbo.[SupportDocuments] ([DocumentTitleEN],[DocumentTitleAR],[DocumentDescriptionEN],[DocumentDescriptionAR],[DocumentFile]) VALUES (@DocumentTitleEN,@DocumentTitleAR,@DocumentDescriptionEN,@DocumentDescriptionAR,@DocumentFile) ; select SCOPE_IDENTITY() ";
 object scope = con.ExecuteScalar(strQuery, CommandType.Text, prmDocumentTitleEN,prmDocumentTitleAR,prmDocumentDescriptionEN,prmDocumentDescriptionAR,prmDocumentFile);


                    try
                    {
                        obj.ID = System.Int64.Parse(scope.ToString());
                    }
                    catch
                    {
                        obj.ID = -1;
                    }


                    


           

        }



        public void Insert(SupportDocuments obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
            con.OpenConnection();

            Insert(con,obj);


            con.CloseConnection();
        }




        public void Update(ClassDataHandler con, SupportDocuments obj)
        {
            
            

                    DbParameter prmID = con.createParameter();
                    prmID.ParameterName = "@ID";
                    prmID.DbType =DbType.Int64;
                    if (obj.ID == null)
                    {
                        prmID.Value = DBNull.Value;
                    }
                    else
                    {
                        prmID.Value = obj.ID;
                    }
                

                    


                    DbParameter prmDocumentTitleEN = con.createParameter();
                    prmDocumentTitleEN.ParameterName = "@DocumentTitleEN";
                    prmDocumentTitleEN.DbType =DbType.String;
                    if (obj.DocumentTitleEN == null)
                    {
                        prmDocumentTitleEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentTitleEN.Value = obj.DocumentTitleEN;
                    }
                

                    


                    DbParameter prmDocumentTitleAR = con.createParameter();
                    prmDocumentTitleAR.ParameterName = "@DocumentTitleAR";
                    prmDocumentTitleAR.DbType =DbType.String;
                    if (obj.DocumentTitleAR == null)
                    {
                        prmDocumentTitleAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentTitleAR.Value = obj.DocumentTitleAR;
                    }
                

                    


                    DbParameter prmDocumentDescriptionEN = con.createParameter();
                    prmDocumentDescriptionEN.ParameterName = "@DocumentDescriptionEN";
                    prmDocumentDescriptionEN.DbType =DbType.String;
                    if (obj.DocumentDescriptionEN == null)
                    {
                        prmDocumentDescriptionEN.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentDescriptionEN.Value = obj.DocumentDescriptionEN;
                    }
                

                    


                    DbParameter prmDocumentDescriptionAR = con.createParameter();
                    prmDocumentDescriptionAR.ParameterName = "@DocumentDescriptionAR";
                    prmDocumentDescriptionAR.DbType =DbType.String;
                    if (obj.DocumentDescriptionAR == null)
                    {
                        prmDocumentDescriptionAR.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentDescriptionAR.Value = obj.DocumentDescriptionAR;
                    }
                

                    


                    DbParameter prmDocumentFile = con.createParameter();
                    prmDocumentFile.ParameterName = "@DocumentFile";
                    prmDocumentFile.DbType =DbType.String;
                    if (obj.DocumentFile == null)
                    {
                        prmDocumentFile.Value = DBNull.Value;
                    }
                    else
                    {
                        prmDocumentFile.Value = obj.DocumentFile;
                    }
                

                    


           



            string strQuery = " update dbo.[SupportDocuments] set [DocumentTitleEN]=@DocumentTitleEN,[DocumentTitleAR]=@DocumentTitleAR,[DocumentDescriptionEN]=@DocumentDescriptionEN,[DocumentDescriptionAR]=@DocumentDescriptionAR,[DocumentFile]=@DocumentFile where  [ID]=@ID  ";

            con.ExecuteNonQuery(strQuery, CommandType.Text,prmID,prmDocumentTitleEN,prmDocumentTitleAR,prmDocumentDescriptionEN,prmDocumentDescriptionAR,prmDocumentFile);

            

        }


        public void Update(SupportDocuments obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
            con.OpenConnection();

            Update(con, obj);


            con.CloseConnection();
        }



        public void Delete(ClassDataHandler con, SupportDocuments obj)
        {

            

                    DbParameter prmID = con.createParameter();
                    prmID.ParameterName = "@ID";
                    prmID.DbType =DbType.Int64;
                    if (obj.ID == null)
                    {
                        prmID.Value = DBNull.Value;
                    }
                    else
                    {
                        prmID.Value = obj.ID;
                    }
                

                    


           



           



            string strQuery = " delete from dbo.[SupportDocuments]  where  [ID]=@ID  "; 
                        con.ExecuteNonQuery(strQuery, CommandType.Text,prmID );  

             



        }


        public void Delete( SupportDocuments obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            Delete(con, obj);

            con.CloseConnection();
        }





                    public List<SupportDocuments> getSupportDocumentsByID(ClassDataHandler con,System.Int64 ID)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();


                        DbParameter prmID = con.createParameter();
                        prmID.ParameterName = "@ID";
                        prmID.DbType = DbType.Int64;
                        if (ID == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmID.Value = ID;
                        }


                        lstRet = Select(con, "" , " where [ID]=@ID ", prmID);



                        return lstRet;

                    }


                    public List<SupportDocuments> getSupportDocumentsByID(System.Int64 ID)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getSupportDocumentsByID(con, ID);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<SupportDocuments> getSupportDocumentsByDocumentTitleEN(ClassDataHandler con,System.String DocumentTitleEN)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();


                        DbParameter prmDocumentTitleEN = con.createParameter();
                        prmDocumentTitleEN.ParameterName = "@DocumentTitleEN";
                        prmDocumentTitleEN.DbType = DbType.String;
                        if (DocumentTitleEN == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmDocumentTitleEN.Value = DocumentTitleEN;
                        }


                        lstRet = Select(con, "" , " where [DocumentTitleEN]=@DocumentTitleEN ", prmDocumentTitleEN);



                        return lstRet;

                    }


                    public List<SupportDocuments> getSupportDocumentsByDocumentTitleEN(System.String DocumentTitleEN)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getSupportDocumentsByDocumentTitleEN(con, DocumentTitleEN);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<SupportDocuments> getSupportDocumentsByDocumentTitleAR(ClassDataHandler con,System.String DocumentTitleAR)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();


                        DbParameter prmDocumentTitleAR = con.createParameter();
                        prmDocumentTitleAR.ParameterName = "@DocumentTitleAR";
                        prmDocumentTitleAR.DbType = DbType.String;
                        if (DocumentTitleAR == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmDocumentTitleAR.Value = DocumentTitleAR;
                        }


                        lstRet = Select(con, "" , " where [DocumentTitleAR]=@DocumentTitleAR ", prmDocumentTitleAR);



                        return lstRet;

                    }


                    public List<SupportDocuments> getSupportDocumentsByDocumentTitleAR(System.String DocumentTitleAR)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getSupportDocumentsByDocumentTitleAR(con, DocumentTitleAR);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<SupportDocuments> getSupportDocumentsByDocumentDescriptionEN(ClassDataHandler con,System.String DocumentDescriptionEN)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();


                        DbParameter prmDocumentDescriptionEN = con.createParameter();
                        prmDocumentDescriptionEN.ParameterName = "@DocumentDescriptionEN";
                        prmDocumentDescriptionEN.DbType = DbType.String;
                        if (DocumentDescriptionEN == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmDocumentDescriptionEN.Value = DocumentDescriptionEN;
                        }


                        lstRet = Select(con, "" , " where [DocumentDescriptionEN]=@DocumentDescriptionEN ", prmDocumentDescriptionEN);



                        return lstRet;

                    }


                    public List<SupportDocuments> getSupportDocumentsByDocumentDescriptionEN(System.String DocumentDescriptionEN)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getSupportDocumentsByDocumentDescriptionEN(con, DocumentDescriptionEN);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<SupportDocuments> getSupportDocumentsByDocumentDescriptionAR(ClassDataHandler con,System.String DocumentDescriptionAR)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();


                        DbParameter prmDocumentDescriptionAR = con.createParameter();
                        prmDocumentDescriptionAR.ParameterName = "@DocumentDescriptionAR";
                        prmDocumentDescriptionAR.DbType = DbType.String;
                        if (DocumentDescriptionAR == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmDocumentDescriptionAR.Value = DocumentDescriptionAR;
                        }


                        lstRet = Select(con, "" , " where [DocumentDescriptionAR]=@DocumentDescriptionAR ", prmDocumentDescriptionAR);



                        return lstRet;

                    }


                    public List<SupportDocuments> getSupportDocumentsByDocumentDescriptionAR(System.String DocumentDescriptionAR)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getSupportDocumentsByDocumentDescriptionAR(con, DocumentDescriptionAR);

                        con.CloseConnection();

                        return lstRet;

                    }



                

                    public List<SupportDocuments> getSupportDocumentsByDocumentFile(ClassDataHandler con,System.String DocumentFile)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();


                        DbParameter prmDocumentFile = con.createParameter();
                        prmDocumentFile.ParameterName = "@DocumentFile";
                        prmDocumentFile.DbType = DbType.String;
                        if (DocumentFile == null)
                        {
                            return lstRet;
                        }
                        else
                        {
                            prmDocumentFile.Value = DocumentFile;
                        }


                        lstRet = Select(con, "" , " where [DocumentFile]=@DocumentFile ", prmDocumentFile);



                        return lstRet;

                    }


                    public List<SupportDocuments> getSupportDocumentsByDocumentFile(System.String DocumentFile)
                    {
                        List<SupportDocuments> lstRet = new List<SupportDocuments>();

                        ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);
                        con.OpenConnection();

                        lstRet = getSupportDocumentsByDocumentFile(con, DocumentFile);

                        con.CloseConnection();

                        return lstRet;

                    }



                

            
public List<SupportDocuments> Search(ClassDataHandler con, SupportDocuments obj)
        {
            string strWhere = "";
            List<DbParameter> lstParameters = new List<DbParameter>();

            
                    if (obj.ID != -1)
                    {
                        DbParameter prmID = con.createParameter();
                        prmID.ParameterName = "@ID";
                        prmID.DbType =DbType.Int64;
                        if (obj.ID == null)
                        {
                            prmID.Value = DBNull.Value;
                        }
                        else
                        {
                            prmID.Value = obj.ID;
                        }
                        strWhere += " [ID]=@ID AND ";
                        lstParameters.Add(prmID);
                     }



                    

                    if (obj.DocumentTitleEN != "")
                    {
                        DbParameter prmDocumentTitleEN = con.createParameter();
                        prmDocumentTitleEN.ParameterName = "@DocumentTitleEN";
                        prmDocumentTitleEN.DbType =DbType.String;
                        if (obj.DocumentTitleEN == null)
                        {
                            prmDocumentTitleEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentTitleEN.Value = obj.DocumentTitleEN;
                        }
                        strWhere += " [DocumentTitleEN]=@DocumentTitleEN AND ";
                        lstParameters.Add(prmDocumentTitleEN);
                     }



                    

                    if (obj.DocumentTitleAR != "")
                    {
                        DbParameter prmDocumentTitleAR = con.createParameter();
                        prmDocumentTitleAR.ParameterName = "@DocumentTitleAR";
                        prmDocumentTitleAR.DbType =DbType.String;
                        if (obj.DocumentTitleAR == null)
                        {
                            prmDocumentTitleAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentTitleAR.Value = obj.DocumentTitleAR;
                        }
                        strWhere += " [DocumentTitleAR]=@DocumentTitleAR AND ";
                        lstParameters.Add(prmDocumentTitleAR);
                     }



                    

                    if (obj.DocumentDescriptionEN != "")
                    {
                        DbParameter prmDocumentDescriptionEN = con.createParameter();
                        prmDocumentDescriptionEN.ParameterName = "@DocumentDescriptionEN";
                        prmDocumentDescriptionEN.DbType =DbType.String;
                        if (obj.DocumentDescriptionEN == null)
                        {
                            prmDocumentDescriptionEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentDescriptionEN.Value = obj.DocumentDescriptionEN;
                        }
                        strWhere += " [DocumentDescriptionEN]=@DocumentDescriptionEN AND ";
                        lstParameters.Add(prmDocumentDescriptionEN);
                     }



                    

                    if (obj.DocumentDescriptionAR != "")
                    {
                        DbParameter prmDocumentDescriptionAR = con.createParameter();
                        prmDocumentDescriptionAR.ParameterName = "@DocumentDescriptionAR";
                        prmDocumentDescriptionAR.DbType =DbType.String;
                        if (obj.DocumentDescriptionAR == null)
                        {
                            prmDocumentDescriptionAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentDescriptionAR.Value = obj.DocumentDescriptionAR;
                        }
                        strWhere += " [DocumentDescriptionAR]=@DocumentDescriptionAR AND ";
                        lstParameters.Add(prmDocumentDescriptionAR);
                     }



                    

                    if (obj.DocumentFile != "")
                    {
                        DbParameter prmDocumentFile = con.createParameter();
                        prmDocumentFile.ParameterName = "@DocumentFile";
                        prmDocumentFile.DbType =DbType.String;
                        if (obj.DocumentFile == null)
                        {
                            prmDocumentFile.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentFile.Value = obj.DocumentFile;
                        }
                        strWhere += " [DocumentFile]=@DocumentFile AND ";
                        lstParameters.Add(prmDocumentFile);
                     }



                    


            if (strWhere != "")
                        strWhere = " where " + strWhere.Substring(0, strWhere.LastIndexOf("AND"));

                    

            

            List<SupportDocuments> lstRet = Select(con, "", strWhere, lstParameters.ToArray());

            return lstRet;
        }


        public List<SupportDocuments> Search(SupportDocuments obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            List<SupportDocuments> lstRet = Search(con,obj);

            con.CloseConnection();

            return lstRet;
        }


                

            
public List<SupportDocuments> SearchOrLike(ClassDataHandler con, SupportDocuments obj)
        {
            string strWhere = "";
            List<DbParameter> lstParameters = new List<DbParameter>();

            
                    if (obj.ID != -1)
                    {
                        DbParameter prmID = con.createParameter();
                        prmID.ParameterName = "@ID";
                        prmID.DbType =DbType.Int64;
                        if (obj.ID == null)
                        {
                            prmID.Value = DBNull.Value;
                        }
                        else
                        {
                            prmID.Value = obj.ID;
                        }
                        strWhere += " [ID]=@ID OR ";
                        lstParameters.Add(prmID);
                     }



                    

                    if (obj.DocumentTitleEN != "")
                    {
                        DbParameter prmDocumentTitleEN = con.createParameter();
                        prmDocumentTitleEN.ParameterName = "@DocumentTitleEN";
                        prmDocumentTitleEN.DbType =DbType.String;
                        if (obj.DocumentTitleEN == null)
                        {
                            prmDocumentTitleEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentTitleEN.Value = obj.DocumentTitleEN;
                        }
                        strWhere += " [DocumentTitleEN] LIKE @DocumentTitleEN OR ";
                        lstParameters.Add(prmDocumentTitleEN);
                     }



                    

                    if (obj.DocumentTitleAR != "")
                    {
                        DbParameter prmDocumentTitleAR = con.createParameter();
                        prmDocumentTitleAR.ParameterName = "@DocumentTitleAR";
                        prmDocumentTitleAR.DbType =DbType.String;
                        if (obj.DocumentTitleAR == null)
                        {
                            prmDocumentTitleAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentTitleAR.Value = obj.DocumentTitleAR;
                        }
                        strWhere += " [DocumentTitleAR] LIKE @DocumentTitleAR OR ";
                        lstParameters.Add(prmDocumentTitleAR);
                     }



                    

                    if (obj.DocumentDescriptionEN != "")
                    {
                        DbParameter prmDocumentDescriptionEN = con.createParameter();
                        prmDocumentDescriptionEN.ParameterName = "@DocumentDescriptionEN";
                        prmDocumentDescriptionEN.DbType =DbType.String;
                        if (obj.DocumentDescriptionEN == null)
                        {
                            prmDocumentDescriptionEN.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentDescriptionEN.Value = obj.DocumentDescriptionEN;
                        }
                        strWhere += " [DocumentDescriptionEN] LIKE @DocumentDescriptionEN OR ";
                        lstParameters.Add(prmDocumentDescriptionEN);
                     }



                    

                    if (obj.DocumentDescriptionAR != "")
                    {
                        DbParameter prmDocumentDescriptionAR = con.createParameter();
                        prmDocumentDescriptionAR.ParameterName = "@DocumentDescriptionAR";
                        prmDocumentDescriptionAR.DbType =DbType.String;
                        if (obj.DocumentDescriptionAR == null)
                        {
                            prmDocumentDescriptionAR.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentDescriptionAR.Value = obj.DocumentDescriptionAR;
                        }
                        strWhere += " [DocumentDescriptionAR] LIKE @DocumentDescriptionAR OR ";
                        lstParameters.Add(prmDocumentDescriptionAR);
                     }



                    

                    if (obj.DocumentFile != "")
                    {
                        DbParameter prmDocumentFile = con.createParameter();
                        prmDocumentFile.ParameterName = "@DocumentFile";
                        prmDocumentFile.DbType =DbType.String;
                        if (obj.DocumentFile == null)
                        {
                            prmDocumentFile.Value = DBNull.Value;
                        }
                        else
                        {
                            prmDocumentFile.Value = obj.DocumentFile;
                        }
                        strWhere += " [DocumentFile] LIKE @DocumentFile OR ";
                        lstParameters.Add(prmDocumentFile);
                     }



                    


            if (strWhere != "")
                        strWhere = " where " + strWhere.Substring(0, strWhere.LastIndexOf("OR"));

                    

            

            List<SupportDocuments> lstRet = Select(con, "", strWhere, lstParameters.ToArray());

            return lstRet;
        }


        public List<SupportDocuments> SearchOrLike(SupportDocuments obj)
        {
            ClassDataHandler con = new ClassDataHandler(_Connection, _Provider);

            con.OpenConnection();

            List<SupportDocuments> lstRet = SearchOrLike(con,obj);

            con.CloseConnection();

            return lstRet;
        }


                
        


       
        



    }
}











            